This code shows data with the US population (in millions) from 1790 to 1970. We will plot this data with the plotly package.
data(uspop) data <- data.frame(uspop) data$year <- seq(1790,1970,by=10) head(data)
uspop year 1 3.93 1790 2 5.31 1800 3 7.24 1810 4 9.64 1820 5 12.90 1830 6 17.10 1840